package com.cjm.one.custom.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.constant.ServerConstants;
import com.cjm.one.common.result.Result;
import com.cjm.one.model.custom.entity.CustomGrade;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = ServerConstants.SERVER_ONE_CUSTOM)
public interface CustomGradeClient {
    @GetMapping("/admin/customer/grade/list")
    @Operation(summary = "获取用户等级列表")
    Result<Page<CustomGrade>> list(@RequestParam(defaultValue = "1") Integer current,
                                          @RequestParam(defaultValue = "10") Integer size);


    @GetMapping("/admin/customer/grade/{id}")
    @Operation(summary = "获取用户等级详情")
    Result<CustomGrade> getInfo(@PathVariable(name = "id") Long id);
    @PostMapping("/admin/customer/grade")
    @Operation(summary = "创建用户等级")
    Result<Boolean> create(@RequestBody CustomGrade customGrade);

    @PutMapping("/admin/customer/grade")
    @Operation(summary = "更新用户等级")
    Result<Boolean> update(@RequestBody CustomGrade customGrade);

    @DeleteMapping("/admin/customer/grade/{id}")
    @Operation(summary = "删除用户等级")
    Result<Boolean> delete(@PathVariable(name = "id") Long id);

    @PutMapping("/admin/customer/grade/{id}/{status}/status")
    @Operation(summary = "更新用户等级状态")
    Result<Boolean> updateStatus(@PathVariable(name = "id") Long id,@PathVariable(name="status")Integer status);

}
